The UK TeX FAQ
ثبت نشده
چکیده
sty: macros/latex/contrib/abstract memoir.cls: macros/latex/contrib/memoir 185 Really blank pages between chapters Book (by default) and report (with openright class option) ensure that each chapterstarts on a right-hand (recto) page; they do this by inserting a \cleardoublepagecommand between chapters (rather than a mere \clearpage). The empty page thuscreated gets to have a normal running header, which some people don’t like.The (excellent) fancyhdr manual covers this issue, basically advising the creationof a command \clearemptydoublepage: \let\origdoublepage\cleardoublepage\newcommand{\clearemptydoublepage}{%\clearpage{\pagestyle{empty}\origdoublepage}%} The “obvious” thing is then to use this command to replace \cleardoublepage in apatched version of the \chapter command. (Make a package of your own containinga copy of the command out of the class.) This isn’t particularly difficult, but you caninstead simply subvert \cleardoublepage (which isn’t often used elsewhere): \let\cleardoublepage\clearemptydoublepage Note: this command works because \clearemptydoublepage uses a copy of \cleardoublepage:instructions on macro programming patching techniques explain the problem and whythis is a solution.Note that the KOMA-Script replacements for the book amd report classes (scrbookand scrreprt offers class options cleardoubleempty, cleardoubleplain and cleardoublestandard(using the running page style, as normal) that control the appearance of these emptypages. The classes also offer do-it-yourself commands \cleardoubleempty (etc.).The memoir class (and the nextpage package) provide commands \cleartooddpageand \cleartoevenpage, which both take an optional argument (the first, with no ar-gument, being an equivalent of \cleardoublepage). One can achieve ‘special’ effectsby putting commands in the optional argument: the \clearemptydoublepage we’reafter would be achieved by \cleartooddpage[\thispagestyle{empty}]. Thecommands will also serve if you want the surreal effect of “This page intentionally leftblank” in the centre of an otherwise empty page. fancyhdr: macros/latex/contrib/fancyhdr memoir.cls: macros/latex/contrib/memoir nextpage.sty: macros/latex/contrib/misc/nextpage.sty scrbook.cls, scrrept.cls: Part of macros/latex/contrib/koma-script 186 Balancing columns at the end of a document The twocolumn option of the standard classes causes LaTeX to set the text of a doc-ument in two columns. However, the last page of the document typically ends upwith columns of different lengths — such columns are said to be “unbalanced”. Many(most?) people don’t like unbalanced columns.108 The simplest solution to the problem is to use the multicol package in place of thetwocolumn option, as multicol balances the columns on the final page by default. How-ever, the use of multicol does come at a cost: its special output routine disallows the useof in-column floats, though it does still permit full-width (e.g., figure* environment)floats.As a result, there is a constant push for a means of balancing columns at the endof a twocolumn document. Of course, the job can be done manually: \pagebreakinserted at the appropriate place on the last page can often produce the right effect, butthis seldom appeals, and if the last page is made up of automatically-generated text (forexample, bibliography or index) inserting the command will be difficult.The flushend package offers a solution to this problem. It’s a somewhat dangerouspiece of macro code, which patches one of the most intricate parts of the LaTeX kernelwithout deploying any of the safeguards discussed in patching commands. The packageonly changes the behaviour at end document (its \flushend command is enabled bydefault), and one other command permits adjustment of the final balance; other pack-ages in the bundle provide means for insertion of full width material in two-columndocuments.The balance package also patches the output routine (somewhat more carefullythan flushend).The user should be aware that any of these packages are liable to become confusedin the presence of floats: if problems arise, manual adjustment of the floats in thedocument is likely to be necessary. It is this difficulty (what’s required in any instancecan’t really be expressed in current LaTeX) that led the author of multicol to suppresssingle-column-wide floats. balance.sty: Distributed as part of macros/latex/contrib/preprint flushend.sty: Distributed as part of macros/latex/contrib/sttools multicol.sty: Distributed as part of macros/latex/required/tools 187 My section title is too wide for the page header By default, LaTeX sectioning commands make the chapter or section title available foruse by page headers and the like. Page headers operate in a rather constrained area, andit’s common for titles too be too big to fit: the LaTeX sectioning commands thereforetake an optional argument: \section[short title]{full title} If the 〈short title〉 is present, it is used both for the table of contents and for the pageheading. The usual answer to people who complain that their title is too big for therunning head is to suggest that they the optional argument.However, using the same text for the table of contents as for the running head mayalso be unsatisfactory: if your chapter titles are seriously long (like those of a Victoriannovel), a valid and rational scheme is to have a shortened table of contents entry, and areally terse entry in the running head.One of the problems is the tendency of page headings to be set in capitals (whichtake up more space); so why not set headings as written for “ordinary” reading? It’snot possible to do so with unmodified LaTeX, but the fancyhdr package provides acommand \nouppercase for use in its header (and footer) lines to suppress LaTeX’suppercasing tendencies. Classes in the KOMA-script bundle don’t uppercase in the firstplace.In fact, the sectioning commands use ‘mark’ commands to pass information tothe page headers. For example, \chapter uses \chaptermark, \section uses\sectionmark, and so on. With this knowledge, one can achieve a three-layer struc-ture for chapters: \chapter[middling version]{verbose version}\chaptermark{terse version} which should supply the needs of every taste.Chapters, however, have it easy: hardly any book design puts a page header ona chapter start page. In the case of sections, one has typically to take account of thenature of the \*mark commands: the thing that goes in the heading is the first markon the page (or, failing any mark, the last mark on any previous page). As a result therecipe for sections is more tiresome:109 \section[middling version]{verbose version%\sectionmark{terse version}}\sectionmark{terse version} (the first \sectionmark deals with the header of the page the \section command fallson, and the second deal with subsequent pages; note that here, you need the optionalargument to \section, even if “middling version” is in fact the same text as “longversion”.)A similar arrangement is necessary even for chapters if the class you’re using isodd enough that it puts a page header on a chapter’s opening page.Note that the titlesec package manages the running heads in a completely differentfashion; users of that package should refer to the documentation.The memoir class avoids all the silliness by providing an extra optional argumentfor chapter and sectioning commands, for example: \section[middling version][terse version]{verbose version} As a result, it is always possible for users of memoir to tailor the header text to fit, withvery little trouble. fancyhdr.sty: macros/latex/contrib/fancyhdr KOMA script bundle: macros/latex/contrib/koma-script memoir.cls: macros/latex/contrib/memoir titlesec.sty: macros/latex/contrib/titlesec 188 Page numbering “〈n〉 of 〈m〉” Finding the page number of the last page of a document, from within the document, issomewhat tricky. The lastpage package is therefore supplied to make life easy for usall; it defines a label LastPage whose number is right (after sufficiently many passesthrough LaTeX, of course). The memoir class also defines a “last page” label.The documentation of the fancyhdr package spells out exactly how one might ac-tually use this information to produce page numbering as suggested in the question. fancyhdr documentation: macros/latex/contrib/fancyhdr lastpage.sty: macros/latex/contrib/lastpage 189 Page numbering by chapter When I was a young man, a common arrangement for loose bound technical manualsis to number pages by chapter. (It’s quite a good scheme, in those situations: even ifyour corrections add a whole page to the chapter, the most you have to redistribute isthat chapter.)The problem, at first sight, seems pretty much the same as that in another answeron running numbers within a chapter, and the basic technique is indeed pretty similar.However, tidying-up loose ends, making sure the page number gets reset to thecorrect value at the start of each chapter, and so on, is slightly more challenging. Thisis why the chappg package was written: it does the obvious things, and more.Users have been known to ask for running page numbers within a section, but thisreally doesn’t make sense: you need to run page numbers within document objects thatalways start on a fresh page.Documentation of chappg is to be found in the package file. chappg.sty: macros/latex/contrib/chappg P.3 Page layout190 Printer paper sizes If you’re looking at this answer, it’s likely you have a problem with fitting output to thepage. It may be a common problem with Adobe [Acrobat] Reader: printing from thatprogram by default shrinks the page ”to fit”. Unfortunately, its calculation doesn’t takethe existing margins of the document into account, so that it shrinks what it believes isyour whole page onto what it believes is its output page. The effect typically looks asif your margins have expanded.Solve this problem by adjusting the Reader’s default in the print dialogue; unfor-tunately, this dialogue varies from one version to the next. On Reader version 7, thereare two entries to check:110 Page Scaling (default: ”Fit to printer margins”) — change to ”None”, andScale (default 95% of Normal size) — change to ”100%”. More generally, we should recognise that paper sizes can be a pain: they’re a for-gotten backwater, because there’s no DVI command to specify the paper size of thedocument. One usually finds American “letter” paper size being assumed, by default,in macro packages (such as plain TeX and LaTeX); but distributions provide separateconfiguration files for DVI drivers. Since most distributions nowadays originate inEurope, the drivers usually default to ISO “A4” paper size.This is (of course) pretty unsatisfactory. Users may change the paper size theirdocument is designed for, pretty easily (and once off), but they have to ensure thatevery run of xdvi, dvips, or whatever, is given the correct override for using anythingnon-‘standard’.Furthermore, the default paper size for DVI drivers may be changed by a distribu-tion management command, but this still doesn’t provide for people using the “wrong”sort of paper for some reason.An interestingly different issue arises for users of PDFTeX — the PDF formatdoes have the means of expressing paper size, but much of the core software pre-dates PDFTeX, so not even PDFLaTeX sets the correct values into \pdfpagewidthand \pdfpageheight.The DVI drivers dvips and dvipdfm define \special commands for the documentto specify its own paper size; so in those cases, as in the case of PDFTeX and VTeX,the paper size can be programmed by the document. Users who wish to, may of courseconsult the manuals of the various programs to write the necessary code.The geometry package (whose main business is defining typeset page areas), alsotakes notice of the paper size the document is going to print to, and can issue thecommands necessary to ensure the correct size is used. If geometry is used when adocument is being processed by either PDFLaTeX or VTeX, it can set the necessarydimensions ”in the output”. If the document is being processed by LaTeX on a TeXor e-TeX engine, there are two package options (dvipdfm and dvips) which instructgeometry which \special commands to use. (Note that the options are ignored if youare using either PDFLaTeX or VTeX.)So, the resolution of the problem is to add \usepackage[dvixxx,...]{geometry} (where dvixxx is your current favourite DVI driver), and the document will run cor-rectly with any of LaTeX (whether or not run on VTeX) or PDFLaTeX.Give the typearea package the pagesize and it will do the same job, for PDFLaTeXoutput and PostScript output from LaTeX via dvips. geometry.sty: macros/latex/contrib/geometry typearea.sty: Distributed as part of macros/latex/contrib/koma-script 191 Changing the margins in LaTeX Changing the layout of a document’s text on the page involves several subtleties notoften realised by the beginner. There are interactions between fundamental TeX con-straints, constraints related to the design of LaTeX, and good typesetting and designpractice, that mean that any change must be very carefully considered, both to ensurethat it “works” and to ensure that the result is pleasing to the eye.LaTeX’s defaults sometimes seem excessively conservative, but there are soundreasons behind how Lamport designed the layouts themselves, whatever one may feelabout his overall design. For example, the common request for “one-inch margins allround on A4 paper” is fine for 10or 12-pitch typewriters, but not for 10pt (or even11pt or 12pt) type because readers find such wide, dense, lines difficult to read. Thereshould ideally be no more than 75 characters per line (though the constraints changefor two-column text).So Lamport’s warning to beginners in his section on ‘Customizing the Style’ —“don’t do it” — should not lightly be ignored.This set of FAQs recommends that you use a package to establish consistent settingsof the parameters: the interrelationships are taken care of in the established packages,without you needing to think about them, butThe following answers deal with the ways one may choose to proceed:
منابع مشابه
The UK TeX FAQ
sty : macros/latex/contrib/abstract memoir.cls : macros/latex/contrib/memoir
متن کاملThe UK TeX FAQ
sty: macros/latex/contrib/abstract memoir.cls: macros/latex/contrib/memoir 179 Really blank pages between chapters Book (by default) and report (with openright class option) ensure that each chapterstarts on a right-hand (recto) page; they do this by inserting a \cleardoublepage
متن کاملThe New TEX FAQ : Your 126 Questions Answered Contents The New TEX FAQ
= "{\input{abstracts/long.tex}}"
متن کاملThe UK TeX FAQ
sty: macros/latex/contrib/abstract memoir.cls: macros/latex/contrib/memoir 198 Really blank pages between chapters If you’re using the standard classes, you need to take special action; the memoir classand the Koma-Script classes provide their own support for this — see below.Book (by default) and report (with openright class option) ensure that each chap-ter starts on a right-hand ...
متن کاملInvestigating the Energy Efficiency of TEX High Energy Derivatives with Different Carbon Fuller Nano Structures under Different Temperature Conditions by DFT Method
In this study, high energy energy derivatives of TEX with different carbon-containing fullerenes at different temperature conditions were studied using density functional theory. For this purpose, the materials were first geometric optimized, then the thermodynamic parameters were calculated for all of them. Then, the process of changing the energy-dependent parameters such as specific heat cap...
متن کامل